// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 商品管理
import userDetails from '@/views/goods/Goods';
// 机器信息管理
import Machine from '@/views/machine/Machine';
// 货道信息管理
import userWorkOrder from '@/views/machine/MachineAisle';
/**
 * 订单管理
 */
// 交易订单
import Order from '@/views/pay/Order';
/**
 * 系统管理
 */
// 用户管理
import equipment from '@/views/system/user';
// 菜单管理
import Module from '@/views/system/Module';
// 角色管理
import Role from '@/views/system/Role';
// 公司管理
import Dept from '@/views/system/Dept';
// 系统环境变量
import address from '@/views/system/Variable';
// 权限管理
import Permission from '@/views/system/Permission';
/**
 * 支付管理
 */
// 支付配置信息
import MachineConfig from '@/views/machine/MachineConfig';
// 支付配置
import Config from '@/views/pay/Config';
/**
 * 数据监控
 */
// 监控查询
import druidLogin from '@/views/druid/login';

// 图表界面
import statistics from '@/views/charts/statistics';

import error from '@/components/error';

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
      path: '/error',
      name: '404',
      component: error,
      hidden: true,
      meta: {
        requireAuth: false
      }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/user/details',
            name: '个人信息',
            component: userDetails,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/user/signIn',
            name: '考勤管理',
            component: Machine,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/user/workOrder',
            name: '我的工单',
            component: userWorkOrder,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/user/message',
            name: '留言信息',
            component: Order,
            meta: {
                requireAuth: true
            }
        }, {
          path: '/user/address',
          name: '通讯录',
          component: address,
          meta: {
            requireAuth: true
          }
        }, {
            path: '/meeting/equipment',
            name: '设备管理',
            component: equipment,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/clerk/list',
            name: '职员列表',
            component: Module,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/role',
            name: '角色管理',
            component: Role,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/department',
            name: '部门管理',
            component: Dept,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/clerk/work',
            name: '下发工单',
            component: Permission,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/meeting/root',
            name: '会议室管理',
            component: MachineConfig,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/meeting/list',
            name: '会议列表',
            component: Config,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/meeting/apply',
            name: '会议申请',
            component: druidLogin,
            meta: {
                requireAuth: true
            }
        }, /*{
            path: '/charts/statistics',
            name: '数据可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }*/]
    }]
})
